public class TupleTypeMap
{
	public static final String NULL   = "NULL";

	public static final String INT    = "INT";
	public static final String LONG   = "LONG";
	public static final String CHAR   = "CHAR";
	public static final String SHORT  = "SHORT";
	public static final String STRING = "STRING";

	public static String tupleTypeToString(TupleType typeElement)
	{
		switch (typeElement)
		{
			case NULL:
				return TupleTypeMap.NULL;
			case INT:
				return TupleTypeMap.INT;			
			case STRING:
				return TupleTypeMap.STRING;			
			case LONG:
				return TupleTypeMap.LONG;			
			case CHAR:
				return TupleTypeMap.CHAR;				
			case SHORT:
				return TupleTypeMap.SHORT;
		}

		throw new RuntimeException("tupleTypeToString: Should not enter in here!"); 		
	}

	public static TupleType stringToTupleType(String typeElement)
	{
		/**/ if (typeElement.equals(NULL))
			return TupleType.NULL;
		else if (typeElement.equals(INT))
			return TupleType.INT;
		else if (typeElement.equals(STRING))
			return TupleType.STRING;
		else if (typeElement.equals(LONG))
			return TupleType.LONG;
		else if (typeElement.equals(CHAR))
			return TupleType.CHAR;
		else if (typeElement.equals(SHORT))
			return TupleType.SHORT;

		throw new RuntimeException("stringtoToTupleType: Should not enter in here!"); 		
	}

	public static boolean validateString(String typeElement)
	{
		/**/ if (typeElement.equals(NULL))
			return true;
		else if (typeElement.equals(INT))
			return true;
		else if (typeElement.equals(STRING))
			return true;
		else if (typeElement.equals(LONG))
			return true;
		else if (typeElement.equals(CHAR))
			return true;
		else if (typeElement.equals(SHORT))
			return true;
		
		return false;
	}
}

